package com.vhall.component.controller.vote.facade;


import com.vhall.component.entity.vote.vo.VoteDetailReqVO;
import com.vhall.component.entity.vote.vo.VoteDetailRspVO;
import com.vhall.component.entity.vote.vo.VoteInfoReqVO;
import com.vhall.component.entity.vote.vo.VoteInfoRspVO;
import com.vhall.component.entity.vote.vo.room.CheckSurveyReqVO;
import com.vhall.component.entity.vote.vo.room.CheckSurveyRspVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 投票API
 *
 * @author longzhen.gong
 * @date 2021/7/6 11:14
 */
@FeignClient(name = "VoteApiFacade", path = "/v4/api/vote")
public interface VoteApiFacade {


    /**
     * 获取投票的信息
     *
     * @param reqVO
     * @return
     */
    @PostMapping("/info")
    VoteInfoRspVO info(@Validated VoteInfoReqVO reqVO);

    /**
     * 观众端调用 是否提交过投票
     *
     * @param reqVO
     * @return
     */
    @PostMapping("/check-survey")
    CheckSurveyRspVO checkSurvey(@Validated CheckSurveyReqVO reqVO);

    /**
     * 投票详情
     *
     * @param reqVO
     * @return
     */
    @PostMapping("/vote-detail")
    List<VoteDetailRspVO> voteDetail(@Validated VoteDetailReqVO reqVO);

    /**
     * 投票先提交表单
     *
     * @param client 终端类型，'pc_browser', //PC网页浏览器 'h5_browser', //h5网页浏览器 'android', //安卓手机应用 'ios', //苹果手机应用 'desktop', //桌面客户端 'wechat_browser', //微信内置浏览器 'wechat_applet', //微信小程序
     * @param id     问卷ID question_id
     * @param answer 答案
     * @return
     */
    @PostMapping("/answer/create")
    String answerCreate(@RequestParam("client") String client,
                        @RequestParam("id") String id,
                        @RequestParam("answer") String answer);
}
